import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { RouterModule } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { environment } from '../environments/environment';
import { PaginationComponent } from '../components/pagination/pagination';
import { MatToolbarModule, MatButtonModule, MatTableModule, MatCheckboxModule, MatDialogModule,
  MatFormFieldModule, MatInputModule, MatPaginatorModule, MatPaginatorIntl,
  MatMenuModule, MatSelectModule, MatDatepickerModule, MAT_DATE_LOCALE, MAT_DATE_FORMATS,
} from '@angular/material';
// 日历
import { MatMomentDateModule } from '@angular/material-moment-adapter';
import { myFormats } from '../environments/environment';
// 分页
import { MatPaginatorIntlService } from '../service/matPaginatorIntlService';
import { NgxPaginationModule } from 'ngx-pagination';
// 树
import { TreeModule } from 'angular-tree-component';
// 上传
import { FileUploadModule } from 'ng2-file-upload';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    NgxPaginationModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    MatDialogModule,
    MatToolbarModule,
    NgxPaginationModule,
    MatButtonModule, MatTableModule,
    MatCheckboxModule, MatDialogModule,
    MatFormFieldModule, MatInputModule,
    MatPaginatorModule, MatMenuModule,
    MatSelectModule, MatDatepickerModule, MatMomentDateModule,
    TreeModule.forRoot(),
    FileUploadModule,
  ],
  declarations: [
    PaginationComponent,
  ],
  providers: [
    { provide: MatPaginatorIntl, useClass: MatPaginatorIntlService},
    {provide: MAT_DATE_LOCALE, useValue: 'zh-cn'},
    {provide: MAT_DATE_FORMATS, useValue: myFormats},
  ],
  entryComponents: [

  ],
  exports: [
    CommonModule,
    FormsModule,
    NgxPaginationModule,
    RouterModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    MatToolbarModule,
    MatButtonModule,
    MatTableModule,
    MatCheckboxModule,
    MatDialogModule,
    MatFormFieldModule,
    MatMomentDateModule,
    MatInputModule,
    MatPaginatorModule,
    MatMenuModule,
    MatSelectModule,
    MatDatepickerModule,
    PaginationComponent,
    TreeModule,
    FileUploadModule,
  ]
})
export class ShareModule {
}
